#include <iostream>
#include <conio.h>
#include <string>

using namespace std;

//data struct and onion
typedef struct {
	char name[35];
	int old;
	char sex[4];
	union {
		char namewife[35];
		char namehusband[35];
	};
} Thongtin;

int main(){
	//variable
	Thongtin nhanvien[100];
	int sl;
	int i; //bien chay
	//processing
	cout << "So luong nhan vien cong ty ban: ";
	cin >> sl;
	if (sl > 0)
	{
		for(i = 0; i < sl; ++i)
		{
			cout << "Ten nhan vien " << i+1 <<" :";
			cin >> nhanvien[i].name;
			cout << "Tuoi nhan vien "<< i+1 << " :";
			cin >> nhanvien[i].old;
			cout << "Gioi tinh nhan vien " << i+1 << " :";
			cin >> nhanvien[i].sex;
			if(nhanvien[i].sex == "nam")
			{
				cout << "Ten vo cua nhan vien " << i+1 << " :";
				cin >> nhanvien[i].namewife;
			}
			else
			{
				cout << "Ten chong cua nhan vien " << i+1 << " :";
				cin >> nhanvien[i].namehusband;
			}
		}
	}

	//xuat thong tin nhan vien
	if (sl > 0){
		for(i = 0; i < sl; ++i)
		{
			cout << "Ma so nhan vien: " << i+1 << endl;
			cout << "Name: " <<nhanvien[i].name << endl;
			cout << "Old: " << nhanvien[i].old << endl;
			cout << "Sex: " << nhanvien[i].sex << endl;
			if (nhanvien[i].sex == "nam") 
				cout << "Ten vo: " << nhanvien[i].namewife << endl;
			else 
				cout << "Ten chong :" << nhanvien[i].namehusband << endl;
		}
	
	}
}